import os

def get_all_filename(file_tail,dir):
    ans = []
    list_dir = os.listdir(dir)
    for each in list_dir:
        if each.endswith(file_tail):
            ans.append(each)
    return ans

print(get_all_filename('.pdf','./pdf'))